home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / DRIVETST.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  70 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   DRIVETST.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. $INCLUDE "DAS-NB01.INC"
  22. $INCLUDE "DAS-NB02.INC"
  23. COLOR 7,0
  24. CLS
  25.  
  26. ? "┌─────────────────────────────────────────────────────────────────────────────
  27. ? "│ fIsDrive%    ( Drive$ )
  28. ? "│ fDriveReady% ( Drive$ )                 fChDir%   ( Path$  )
  29. ? "│ fCurDir$     ( Drive$ )                 fChDrive% ( Drive$ )
  30. ? "├─────────────────────────────────────────────────────────────────────────────
  31. ? "│ These functions all return information on the system's currently active
  32. ? "│ drive/path and/or allow you to make changes to it. Their use is quite
  33. ? "│ straight forward and easy. Some of them are parallel to PowerBASIC functions
  34. ? "│ and only remove the requirements of error trapping as a benefit.
  35. ? "│ REMINDER: I have never liked programs that didn't return my system to the
  36. ? "│           exact state it was in when I called the program so a quick call
  37. ? "│           to fCurDir$ will gather this info for your programs and allow
  38. ? "│           you to restore it before you exit.
  39. ? "├─────────────────────────────────────────────────────────────────────────────
  40. ? "│ fMKdir% ( Path$ ) and fRMdir% ( Path$ ) are also available but I will not
  41. ? "│ provide actual code as they work just like the DOS commands and if you wish
  42. ? "│ to see them in actions go for it.
  43. ? "└─────────────────────────────────────────────────────────────────────────────
  44. ?
  45.  
  46. OrigPath$ = fCurDir$( "" )
  47.  
  48. FOR Drives% = 65 TO 90
  49.   IF NOT fIsDrive%( CHR$(Drives%) ) THEN EXIT FOR
  50. NEXT
  51. DECR Drives%, 65
  52.  
  53. PRINT "Your computer's Drive:\Path\ is: "; OrigPath$
  54. PRINT USING "There are # drives available."; Drives%
  55. PRINT "Drive C is reporting that it is ";
  56.       IF NOT fDriveReady%( "C" ) THEN PRINT "NOT ";
  57. PRINT "ready to go!
  58.  
  59. $if 0
  60.   fMkDir "PUREJUNK"         ' make a new directory
  61.   fChDir "PUREJUNK"         ' go to it
  62.   fChDir ".."               ' go back 1 directory (where we were)
  63.   fRmDir "PUREJUNK"         ' remove the new directory
  64. $endif
  65.  
  66. BYEBYE:
  67.   fChDrive OrigPath$
  68.   fChDir   MID$( OrigPath$, 3 )
  69.   END
  70.